<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex flex-wrap align-center justify-between benben-position-layout flex couponMy_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center couponMy_fd0_0' @tap.stop="handleJumpDiy" data-type="back"
          data-url="1">
          <image class='couponMy_fd0_0_c0' mode="aspectFit" :src='STATIC_URL+"234.png"'></image>
        </view>
        <text class='couponMy_fd0_1'>{{$t('我的优惠券')}}</text>
        <view class='flex flex-wrap align-center couponMy_fd0_0'>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <view class="flex benben-position-layout flex flex-wrap align-center couponMy_flex_1"
        :style="{top:(88+StatusBarRpx)+'rpx', }">
        <view>
          <benben-flex-tabs class-name='couponMy_benbenTabsfd1_0' v-model="tabs" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='true' :top='88'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0" @change="getListFunc()">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex flex align-center justify-around">
                  <view :class="{ 'checkTitlefd1_0': tabs == '1', 'flex flex-wrap align-center': true }"
                    @tap="tabs = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

                    <text>{{$t('全部')}}</text>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabs == '2', 'flex flex-wrap align-center': true }"
                    @tap="tabs = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

                    <text>{{$t('未使用')}}</text>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabs == '3', 'flex flex-wrap align-center': true }"
                    @tap="tabs = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

                    <text>{{$t('已过期')}}</text>

                  </view>
                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line couponMy_linefd1_0">
                </view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>

      </view>
      <view :style="{height: '90rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout">
        <template v-for='(item,key0) in dataList'>
          <view class='flex flex-direction align-stretch couponMy_bodyfd2_0_c3' :key='key0'>
            <view class='flex flex-direction flex-wrap align-stretch couponMy_fd2_1_c0' v-if="item.typeCoup=='1'">
              <view class='flex flex-wrap align-center couponMy_fd2_1_c0_c0'>
                <image class='couponMy_fd2_1_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"506.png"'></image>
                <view class='flex flex-direction flex-wrap align-stretch flex-sub couponMy_fd2_1_c0_c0_c1'>
                  <view class='flex flex-wrap align-center'>
                    <text class='couponMy_fd2_1_c0_c0_c1_c0_c0'>{{item.coupTitle}}</text>
                  </view>
                  <view class='flex align-center couponMy_fd2_1_c0_c0_c1_c1'>
                    <text class='couponMy_fd2_1_c0_c0_c1_c1_c0'>有效期至：</text>
                    <text class='couponMy_fd2_1_c0_c0_c1_c1_c0'>{{item.validTime}}</text>
                  </view>
                </view>
                <view class='flex flex-wrap align-center'>
                  <text class='couponMy_fd2_1_c0_c0_c2_c0'>￥</text>
                  <text class=' couponMy_fd2_1_c0_c0_c2_c1'>
                    <text class=' couponMy_price1_fd2_1_c0_c0_c2_c1'>{{ item.fullPrice | frontPrice }}</text>
                    <text class=' couponMy_price2_fd2_1_c0_c0_c2_c1'>{{ item.fullPrice | laterPrice }}</text>
                  </text>
                </view>
              </view>
              <view class='flex flex-wrap align-center justify-between couponMy_fd2_1_c0_c1'>
                <text class='couponMy_fd2_1_c0_c1_c0'>{{item.content}}</text>
                <button class='couponMy_fd2_1_c0_c1_c1' @tap.stop="handleJumpDiy" data-type="switchTab"
                  :data-url="`/pages/tabBar/home/home`">未使用</button>
              </view>
            </view>
            <view class='flex flex-direction flex-wrap align-stretch couponMy_fd2_1_c0' v-if="item.typeCoup=='3'">
              <view class='flex flex-wrap align-center couponMy_fd2_1_c0_c0'>
                <image class='couponMy_fd2_1_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"268.png"'></image>
                <view class='flex flex-direction flex-wrap align-stretch flex-sub couponMy_fd2_1_c0_c0_c1'>
                  <view class='flex flex-wrap align-center'>
                    <text class='couponMy_fd2_1_c1_c0_c1_c0_c0'>{{item.coupTitle}}</text>
                  </view>
                  <view class='flex align-center couponMy_fd2_1_c0_c0_c1_c1'>
                    <text class='couponMy_fd2_1_c1_c0_c1_c1_c0'>有效期至：</text>
                    <text class='couponMy_fd2_1_c1_c0_c1_c1_c0'>{{item.validTime}}</text>
                  </view>
                </view>
                <view class='flex flex-wrap align-center'>
                  <text class='couponMy_fd2_1_c1_c0_c2_c0'>￥</text>
                  <text class=' couponMy_fd2_1_c1_c0_c2_c1'>
                    <text class=' couponMy_price1_fd2_1_c0_c0_c2_c1'>{{ item.fullPrice | frontPrice }}</text>
                    <text class=' couponMy_price2_fd2_1_c0_c0_c2_c1'>{{ item.fullPrice | laterPrice }}</text>
                  </text>
                </view>
              </view>
              <view class='flex flex-wrap align-center justify-between couponMy_fd2_1_c0_c1'>
                <text class='couponMy_fd2_1_c1_c0_c1_c1_c0'>{{item.content}}</text>
                <button class='couponMy_fd2_1_c1_c1_c1'>已使用</button>
              </view>
            </view>
            <view class='flex flex-direction flex-wrap align-stretch couponMy_fd2_1_c0' v-if="item.typeCoup=='3'">
              <view class='flex flex-wrap align-center couponMy_fd2_1_c0_c0'>
                <image class='couponMy_fd2_1_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"268.png"'></image>
                <view class='flex flex-direction flex-wrap align-stretch flex-sub couponMy_fd2_1_c0_c0_c1'>
                  <view class='flex flex-wrap align-center'>
                    <text class='couponMy_fd2_1_c1_c0_c1_c0_c0'>{{item.coupTitle}}</text>
                  </view>
                  <view class='flex align-center couponMy_fd2_1_c0_c0_c1_c1'>
                    <text class='couponMy_fd2_1_c1_c0_c1_c1_c0'>有效期至：</text>
                    <text class='couponMy_fd2_1_c1_c0_c1_c1_c0'>{{item.validTime}}</text>
                  </view>
                </view>
                <view class='flex flex-wrap align-center'>
                  <text class='couponMy_fd2_1_c1_c0_c2_c0'>￥</text>
                  <text class=' couponMy_fd2_1_c1_c0_c2_c1'>
                    <text class=' couponMy_price1_fd2_1_c0_c0_c2_c1'>{{ item.fullPrice | frontPrice }}</text>
                    <text class=' couponMy_price2_fd2_1_c0_c0_c2_c1'>{{ item.fullPrice | laterPrice }}</text>
                  </text>
                </view>
              </view>
              <view class='flex flex-wrap align-center justify-between couponMy_fd2_1_c0_c1'>
                <text class='couponMy_fd2_1_c1_c0_c1_c1_c0'>{{item.content}}</text>
                <button class='couponMy_fd2_1_c1_c1_c1'>已过期</button>
              </view>
            </view>
          </view>
        </template>

        <view class='flex flex-wrap align-center'>
          <benben-empty :list-data="dataList">
            <view class='flex flex-direction flex-wrap align-center couponMy_fd2_2_c0'>
              <image class='couponMy_fd2_2_c0_c0' mode="widthFix" :src='STATIC_URL+"178.png"'></image>
              <!-- <text class='couponMy_fd2_2_c0_c1'>暂无数据</text> -->

            </view>
          </benben-empty>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js';
  import pagingList from '@/common/mixin/paging_list.js';

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd2_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "tabs": "1",
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "dataList": []
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      this.getListFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {
      this.getListFunc()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //优惠券-我的优惠券列表
      async getListFunc() {
        //请求方法
        //数据验证
        this.minixPagingListsApi = global.apiUrls.qryCouponUser;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          stateNum: this.tabs
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .couponMy_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .couponMy_fd0_1 {
    color: #333333;
    font-size: 36rpx;
    font-weight: 500;
    line-height: 50rpx;
  }

  .couponMy_fd0_0_c0 {
    width: 20rpx;
    height: 36rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 0rpx 0rpx 32rpx;
  }

  .couponMy_fd0_0 {
    width: 100rpx;
    height: 88rpx;
  }

  .couponMy_flex_1 {
    width: 750rpx;
    height: 90rpx;
    overflow: hidden;
    z-index: 10;
    top: 88rpx;
  }

  .couponMy_linefd1_0 {
    background: var(--benbenbgColor7);
    width: 50rpx;
    height: 8rpx;
    top: 80rpx;
    background-size: 100% auto !important;
    border-radius: 16rpx;
  }

  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 32rpx !important;
    color: #327FFB !important;
    background-color: rgba(255, 255, 255, 1) !important;
  }

  ::v-deep .couponMy_benbenTabsfd1_0 {
    background: #fff;
    width: 750rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
    font-size: 32rpx;
  }

  .couponMy_fd2_2_c0_c1 {
    padding: 30rpx 0rpx 0rpx 0rpx;
    color: #929292;
  }

  .couponMy_fd2_2_c0_c0 {
    width: 400rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .couponMy_fd2_2_c0 {
    width: 100%;
    padding: 50rpx 0rpx 50rpx 0rpx;
  }

  .couponMy_fd2_1_c1_c1_c1 {
    background: rgba(153, 153, 153, 1);
    border-radius: 24rpx 24rpx 24rpx 24rpx;
    font-size: 24rpx;
    color: #fff;
    width: 120rpx;
    height: 48rpx;
    line-height: 48rpx;
  }

  .couponMy_fd2_1_c1_c0_c2_c1 {
    color: rgba(171, 177, 196, 1);
    font-weight: 600;
  }

  .couponMy_fd2_1_c1_c0_c2_c0 {
    color: rgba(171, 177, 196, 1);
    font-size: 33rpx;
    font-weight: 700;
    line-height: 40rpx;
  }

  .couponMy_fd2_1_c1_c0_c1_c1_c0 {
    color: rgba(171, 177, 196, 1);
    font-size: 24rpx;
    font-weight: 400;
    line-height: 33rpx;
  }

  .couponMy_fd2_1_c1_c0_c1_c0_c0 {
    color: rgba(171, 177, 196, 1);
    font-size: 32rpx;
    font-weight: 500;
    line-height: 45rpx;
  }

  .couponMy_fd2_1_c0_c1_c1 {
    background: var(--benbenbgColor7);
    border-radius: 24rpx 24rpx 24rpx 24rpx;
    font-size: 24rpx;
    color: #fff;
    width: 120rpx;
    height: 48rpx;
    line-height: 48rpx;
  }

  .couponMy_fd2_1_c0_c1_c0 {
    color: #333333;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 33rpx;
  }

  .couponMy_fd2_1_c0_c1 {
    margin: 20rpx 0rpx 0rpx 0rpx;
  }

  .couponMy_price2_fd2_1_c0_c0_c2_c1 {
    font-size: 33rpx;
  }

  .couponMy_price1_fd2_1_c0_c0_c2_c1 {
    font-size: 49rpx;
  }

  .couponMy_fd2_1_c0_c0_c2_c1 {
    color: rgba(240, 35, 37, 1);
    font-weight: 600;
  }

  .couponMy_fd2_1_c0_c0_c2_c0 {
    color: #F02325;
    font-size: 33rpx;
    font-weight: 700;
    line-height: 40rpx;
  }

  .couponMy_fd2_1_c0_c0_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 33rpx;
  }

  .couponMy_fd2_1_c0_c0_c1_c1 {
    margin: 8rpx 0rpx 0rpx 0rpx;
  }

  .couponMy_fd2_1_c0_c0_c1_c0_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
    line-height: 45rpx;
  }

  .couponMy_fd2_1_c0_c0_c1 {
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .couponMy_fd2_1_c0_c0_c0 {
    width: 122rpx;
    height: 100rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .couponMy_fd2_1_c0_c0 {
    border-bottom: 1px dashed rgba(221, 221, 221, 1);
    padding: 0rpx 0rpx 14rpx 0rpx;
  }

  .couponMy_fd2_1_c0 {
    background: url(image-path('267.png')) no-repeat;
    background-size: 100% auto !important;
    padding: 30rpx 31rpx 30rpx 34rpx;
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .couponMy_bodyfd2_0_c3 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .couponMy_linefd2_0 {
    background: var(--benbenbgColor2);
    width: 40rpx;
    height: 6rpx;
    top: 80rpx;
    background-size: 100% auto !important;
    border-radius: 16rpx;
  }

  .checkTitlefd2_0 {
    font-weight: 700 !important;
    font-size: 32rpx !important;
    color: rgba(253, 81, 61, 1) !important;
    background-color: rgba(255, 255, 255, 1) !important;
  }

  ::v-deep .couponMy_benbenTabsfd2_0 {
    background: #fff;
    width: 750rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
    font-size: 32rpx;
    font-weight: 400;
    color: #333333;
  }
</style>
